<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Cases;
use App\Http\Requests;

class CaseController extends Controller
{
    public function detail(Request $request)
    {
        $id = $request->id;
        $id = ($id) ? intval($id) : 0;
        if (!$id) {
            return redirect("/");
        }

        $lesson = Cases::where('id',$id)->first();

        $data = array();
        if ($lesson) {
            $data['case'] = $lesson;
        }
        return view('casedetail',$data);
    }
}
